/*
 * HttpPostExample.h
 *
 * Taken as is from Bada IDE 2.0.4 Examples:
 * bada\2.0.4\Examples\Communication\inc\Http
 *
 */


#ifndef _HTTP_POSTEXAMPLE_H_
#define _HTTP_POSTEXAMPLE_H_

#include <FNet.h>

//This is an example of how to send HTTP Request using POST method.
class HttpPostExample :
	public Osp::Net::Http::IHttpTransactionEventListener
{
public:
	HttpPostExample(void){__isLastData = false;}
	~HttpPostExample(void){}

public:
	void SendPostRequest(void);

public:
	void OnTransactionReadyToRead(Osp::Net::Http::HttpSession& httpSession, Osp::Net::Http::HttpTransaction& httpTransaction, int availableBodyLen);
	void OnTransactionAborted(Osp::Net::Http::HttpSession& httpSession, Osp::Net::Http::HttpTransaction& httpTransaction, result r) {}
	void OnTransactionReadyToWrite(Osp::Net::Http::HttpSession& httpSession, Osp::Net::Http::HttpTransaction& httpTransaction, int recommendedChunkSize);
	void OnTransactionHeaderCompleted(Osp::Net::Http::HttpSession& httpSession, Osp::Net::Http::HttpTransaction& httpTransaction, int headerLen, bool bAuthRequired) {}
	void OnTransactionCompleted(Osp::Net::Http::HttpSession& httpSession, Osp::Net::Http::HttpTransaction& httpTransaction);
	void OnTransactionCertVerificationRequiredN(Osp::Net::Http::HttpSession& httpSession, Osp::Net::Http::HttpTransaction& httpTransaction, Osp::Base::String* pCert) {}

private:
	Osp::Net::Http::HttpSession* 	__pHttpSession;
	bool		 					__isLastData;
};

#endif // _HTTP_POSTEXAMPLE_H_
